<?php

namespace App\Http\Middleware;

use Closure;
use Illuminate\Support\Facades\Log;

class CheckToken
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        $url = $request->fullUrl();
        $params = $request->all();
        $cookies = $_COOKIE;
        if(env('APP_DEBUG'))Log::info('api request:'.json_encode(compact('url','params','cookies')));
        return $next($request);
    }
}
